define([ "PDUtilDir/grid", "PDUtilDir/searchBlock", "PDUtilDir/slidebar" ],
		function(Grid, SearchBlock, Slidebar) {

			function init(addObj, searchObj) {
				SearchBlock.init('searchBlockId');
				// 初始化
				return Grid({
					id : "ProductForSelfGirdDivId",
					pageSize : 10,
					index : true,
					multi : true,
					pagination : true,
					cache : false,
					layout : [ {
						name : "名称",
						field : "name",
						sort : true,
						click : function(e) {
							addObj.run(e.data.row);
						}
					}, {
						name : "主题",
						field : "title",
						width : "10%"
					}, {
						name : "类型",
						field : "type",
						format:function(e){
							if(e.row.type == 'self')
								return '自营';
							return "非自营";
						}
					}, {
						name : "线路",
						field : "lineName"
					}, {
						name : "创建人",
						field : "createUserName"
					}, {
						name : "创建时间",
						field : "createTime"
					} ],
					toolbar : [ {
						name : "查询",
						icon : "fa fa-search",
						callback : function(event) {
						    searchObj.run();
						}
					} ],
					data : {
						type : 'URL',
						value : getServer() + '/flea/hclv/product/queryCurrOrgForSearch.htmls'
					}
				});
			}

			return {
				init : init
			}
		});